* ==============================================================================
*	Title:	'They Take Our Houses': Benefit Competition and the Erosion of Support for Immigrants’ Social Rights
*	Author:	Gerda Hooijer
*	Date:	February 29, 2020
* 	Replication do file for: Online supplement
* ==============================================================================

version 16

set more off


/*
*** Required datasets:
municipality_nl.dta 
nlcoord.dta
NL_housing.dta
NL_newhomes.dta
NL_news.dta
liss_L1L2.dta (restricted access)

*** Required Stata packages:
spmap
st0085_2

*/


* Figure S.1 
* Percentage of foreign-born and new refugees in Dutch municipalities in 2015
use "municipality", clear 

// Panel A: Foreign-born
spmap fb_pct if year==2015 using "nlcoord.dta", id(id) fcolor(BuPu) clmethod(custom) clbreaks(0 5 10 15 35) legstyle(2) legend(size(medium) label(1 "No data") label(2 "0-5%") label(3 "5-10%") label(4 "10-15%") label(5 ">15%") position(4)) title("(a) Foreign-born")

graph export "figure_s1a.pdf", replace

// Panel B: Refugees
spmap rfg_pct if year==2015 using "nlcoord.dta", id(id) fcolor(BuGn) clmethod(custom) clbreaks(0 0.1 0.2 0.3 0.4) legstyle(2) legend(size(medium) label(1 "No data") label(2 "0-0.1%") label(3 "0.1-0.2%") label(4 "0.2-0.3%") label(5 "0.3-0.4%") position(4)) title("(b) New refugees")

graph export "figure_s1b.pdf", replace


* Table S.2 
* Determinants of the number of newly dispersed refugees (2010-2015)
use "municipality", clear 

xtset id year

// Model 0
xtreg refugees i.year if year>2009, fe robust

// Model 1
xtreg refugees target i.year if year>2009, fe robust

// Model 2
xtreg refugees target pop fb_pct asc i.year if year>2009, fe robust

// Model 3
xtreg refugees target pop fb_pct asc sh_pct pr_pct ahv_cpi stu i.year if year>2009, fe robust

// Model 4
xtreg refugees target pop fb_pct asc sh_pct pr_pct ahv_cpi stu leduc_pct ur i.year if year>2009, fe robust

// Model 5
xtreg refugees target pop fb_pct asc sh_pct pr_pct ahv_cpi stu leduc_pct ur i.mainbloc i.year if year>2009, fe robust

// Model 6
xtreg refugees target pop fb_pct asc sh_pct pr_pct ahv_cpi stu leduc_pct ur i.mainbloc vrsh vrpr vroo i.year if year>2009, fe robust


* Figure S.2 
* Total social housing stock since 1901
use "NL_housing", clear 

graph twoway line sh_total year, lpattern(solid) lwidth(medthick) scheme(s1mono) ytitle("Social housing (in millions)", size(medsmall)) xtitle(" ") xlabel(1900(20)2020) yscale(titlegap(*+5)) xscale(titlegap(*+5)) plotregion(style(none)) note(" " "Source: Aedes (2018)") 

graph export "figure_s2.pdf", replace


* Figure S.3 
* Newly built homes in the last decade
use "NL_newhomes", clear 

graph twoway line rental_new total_new year, lpattern(solid dash) lwidth(medthick medthick) scheme(s1mono) legend(order(1 2) label(1 "Newly built rental homes") label(2 "Total newly built homes") col(1) region(lwidth(none))) ytitle("Newly built homes (x 10,000)", size(medsmall)) xtitle(" ") xlabel(2007(1)2016) ylabel(0(2)8) yscale(titlegap(*+5)) xscale(titlegap(*+5)) plotregion(style(none)) note(" " "Source: Aedes (2018)") 

graph export "figure_s3.pdf", replace


* Table S.3 
* Correlation matrix of municipal characteristics
use "municipality", clear 

pwcorr rfg_sh fb_pct sh_pct leduc_pct ur pop pr_pct ahv_cpi stu vrpr vroo if year<2016, sig


* Figure S.4 
* Frequency of articles on refugee housing, social assistance, and youth care
use "NL_news", clear

line refugees_housing socialassistance youthcare year, lpattern(solid longdash shortdash) lwidth(medthick medthick medthick) scheme(s1mono) legend(label(1 "Refugee housing") label(2 "Social assistance") label(3 "Youth care") region(lwidth(none))) ytitle("Number of articles") xtitle(" ") xlabel(2007(2)2018) yline(0) yscale(titlegap(*+5)) plotregion(style(none))

graph export "figure_s4.pdf", replace


* Figure S.5
* Share of articles on refugee housing related to shortages
use "NL_news", clear

graph bar rhs_pct, over(year) scheme(s1mono) plotregion(style(none)) ytitle("Share of articles on shortages (%)", size(med)) ylabel(, nogrid)

graph export "figure_s5.pdf", replace


* Table S.4
* Response rates for each wave of the politics and values module

* The data for this table can be found here: https://www.dataarchive.lissdata.nl/study_units/view/22

 
* Table S.5 
* Respondent characteristics by number of completed questionnaires
use "liss_L1L2", clear

// Number of unique respondents
bysort nomem_encr: gen pid = _n if sample==1

// Number of completed questionnaires by respondent
egen obs = max(pid), by(nomem_encr)
clonevar obs_resp = obs if pid==1
tab obs_resp

// Respondents by number of completed questionnaires
recode obs (1=1) (2=2) (3=3) (4=4) (5/9=5), into(groups)

// Summary statistics by group
eststo clear
bysort groups: eststo: quietly estpost summarize income_cpi3 female age degree unemployed hhsize rfg_sh fb_pct asc sh_pct leduc_pct decline stu if sample==1
esttab, cells("mean") label nodepvar 
 

* Table S.6 
* Support for immigrants' social rights (ordinal)
use "liss_L1L2", clear

tab include1 if sample==1


* Table S.8 
* Summary statistics of the main variables
use "liss_L1L2", clear

xtsum include2 income_cpi3 female age degree unemployed hhsize rfg_sh fb_pct asc sh_pct leduc_pct decline stu if sample==1


* Table S.9 
* Overview of the robustness tests for support for immigrants’ social rights
use "liss_L1L2", clear

* (0) Original results
xtlogit include2 c.income_cpi3##c.rfg_sh age degree hhsize unemployed fb_pct asc sh_pct leduc_pct i.year if sample==1 & sec_target==1 & decline==0, fe or

* (1) Social class
xtlogit include2 c.income_cpi3##c.rfg_sh age degree hhsize unemployed fb_pct asc sh_pct leduc_pct i.soc_class i.year if sample==1 & sec_target==1 & decline==0, fe or

* (2) Authoritarianism
xtlogit include2 c.income_cpi3##c.rfg_sh age degree hhsize unemployed fb_pct asc sh_pct leduc_pct laworder i.year if sample==1 & sec_target==1 & decline==0, fe or

* (3) Urban area
xtlogit include2 c.income_cpi3##c.rfg_sh age degree hhsize unemployed fb_pct asc sh_pct leduc_pct i.sted i.year if sample==1 & sec_target==1 & decline==0, fe or

* (4) Large cities interaction
xtlogit include2 c.income_cpi3##c.rfg_sh##i.g4 age degree hhsize unemployed fb_pct asc sh_pct leduc_pct i.year if sample==1 & sec_target==1 & decline==0, fe or

* (5) Population size
xtlogit include2 c.income_cpi3##c.rfg_sh age degree hhsize unemployed fb_pct asc sh_pct leduc_pct pop i.year if sample==1 & sec_target==1 & decline==0, fe or

* (6) Population density
xtlogit include2 c.income_cpi3##c.rfg_sh age degree hhsize unemployed fb_pct asc sh_pct leduc_pct density i.year if sample==1 & sec_target==1 & decline==0, fe or

* (7) Ideology
xtlogit include2 c.income_cpi3##c.rfg_sh age degree hhsize unemployed fb_pct asc sh_pct leduc_pct ideology i.year if sample==1 & sec_target==1 & decline==0, fe or

* (8) Homeownership 
xtlogit include2 c.income_cpi3##c.rfg_sh age degree hhsize unemployed fb_pct asc sh_pct leduc_pct homeowner i.year if sample==1 & sec_target==1 & decline==0, fe or

* (9) Out of the labor force
xtlogit include2 c.income_cpi3##c.rfg_sh age degree hhsize unemployed fb_pct asc sh_pct leduc_pct inactive i.year if sample==1 & sec_target==1 & decline==0, fe or

* (10) Private rental market
xtlogit include2 c.income_cpi3##c.rfg_sh age degree hhsize unemployed fb_pct asc sh_pct leduc_pct pr_pct i.year if sample==1 & sec_target==1 & decline==0, fe or

* (11) Average housing value
xtlogit include2 c.income_cpi3##c.rfg_sh age degree hhsize unemployed fb_pct asc sh_pct leduc_pct ahv_cpi i.year if sample==1 & sec_target==1 & decline==0, fe or

* (12) Vacant private rental
xtlogit include2 c.income_cpi3##c.rfg_sh age degree hhsize unemployed fb_pct asc sh_pct leduc_pct vrpr i.year if sample==1 & sec_target==1 & decline==0, fe or

* (13) Young adults 
xtlogit include2 c.income_cpi3##c.rfg_sh age degree hhsize unemployed fb_pct asc sh_pct leduc_pct yng_pct i.year if sample==1 & sec_target==1 & decline==0, fe or

* (14) Vacancy rates social housing
xtlogit include2 c.income_cpi3##c.rfg_sh age degree hhsize unemployed fb_pct asc sh_pct leduc_pct vrsh i.year if sample==1 & sec_target==1 & decline==0, fe or 

* (15) Unemployment rate
xtlogit include2 c.income_cpi3##c.rfg_sh age degree hhsize unemployed fb_pct asc sh_pct leduc_pct ur i.year if sample==1 & sec_target==1 & decline==0, fe or

* (16) Industrial jobs
xtlogit include2 c.income_cpi3##c.rfg_sh age degree hhsize unemployed fb_pct asc sh_pct leduc_pct ind_pct i.year if sample==1 & sec_target==1 & decline==0, fe or

* (17) Benefit recipients
xtlogit include2 c.income_cpi3##c.rfg_sh age degree hhsize unemployed fb_pct asc sh_pct leduc_pct bnft_pct i.year if sample==1 & sec_target==1 & decline==0, fe or
 
* (18) Non-trimmed measure
xtlogit include2 c.income_cpi3##c.rfg_sh_all age degree hhsize unemployed fb_pct asc sh_pct leduc_pct i.year if sample==1 & sec_target==1 & decline==0, fe or

* (19) Stock-based measure
xtlogit include2 c.income_cpi3##c.rfg_sh_alt age degree hhsize unemployed fb_pct asc sh_pct leduc_pct i.year if sample==1 & sec_target==1 & decline==0, fe or

* (20) Post-2009 years
xtlogit include2 c.income_cpi3##c.rfg_sh age degree hhsize unemployed fb_pct asc sh_pct leduc_pct i.year if sample==1 & sec_target==1 & decline==0 & year>2009, fe or

* (21) Municipal reforms
xtlogit include2 c.income_cpi3##c.rfg_sh age degree hhsize unemployed fb_pct asc sh_pct leduc_pct i.year if sample==1 & sec_target==1 & decline==0 & reform==0, fe or

* (22) Exposure effect
xtlogit include2 c.rfg_sh##c.fb_pct income_cpi3 age degree hhsize unemployed asc sh_pct leduc_pct i.year if sample==1 & sec_target==1 & decline==0, fe or

* (23) Ethnically homogenous areas
sum fb_pct if sample==1, detail
xtlogit include2 c.income_cpi3##c.rfg_sh age degree hhsize unemployed fb_pct asc sh_pct leduc_pct i.year if sample==1 & sec_target==1 & decline==0 & fb_pct<r(p50), fe or

* (24) Strongly agree
xtlogit strongly_agree c.income_cpi3##c.rfg_sh age degree hhsize unemployed fb_pct asc sh_pct leduc_pct i.year if sample==1 & sec_target==1 & decline==0, fe or

* (25) Ordinal dependent variable
xtreg include1 c.income_cpi3##c.rfg_sh age degree hhsize unemployed fb_pct asc sh_pct leduc_pct i.year if sample==1 & sec_target==1 & decline==0, fe robust

* (26) General pro-immigrant sentiment
xtreg pro_immi c.income_cpi3##c.rfg_sh age degree hhsize unemployed fb_pct asc sh_pct leduc_pct i.year if sample==1 & sec_target==1 & decline==0, fe robust

* (27) Placebo dependent variable
xtlogit care_parents c.income_cpi3##c.rfg_sh age degree hhsize unemployed fb_pct asc sh_pct leduc_pct i.year if sample==1 & sec_target==1 & decline==0, fe or

* (28) Gross income
xtlogit include2 c.gross_cpi3##c.rfg_sh age degree hhsize unemployed fb_pct asc sh_pct leduc_pct i.year if sample==1 & sec_target==1 & decline==0, fe or

* (29) Random effects
xtlogit include2 c.gross_cpi3##c.rfg_sh age degree hhsize unemployed fb_pct asc sh_pct leduc_pct i.year if sample==1 & sec_target==1 & decline==0, re or

* (30) Correlated random effects probit
* see code for Figure 5 in *main_analysis.do* 


* Figure S.6 
* Distribution of support for the right-wing populists over time
use "liss_L1L2", clear

histogram pvv_symp if sample==1 & year<2016, by(year) percent width(1) start(-0.5) scheme(s1mono) 

graph export "figure_s6.pdf", replace


* Table S.10 
* Social housing allocations and support for the populist right
use "liss_L1L2", clear

// Model 1
xtreg pvv_symp c.income_cpi3##c.rfg_sh i.year if sample==1, fe robust

// Model 2
xtreg pvv_symp c.income_cpi3##c.rfg_sh age degree hhsize unemployed fb_pct asc sh_pct leduc_pct decline stu i.year if sample==1, fe robust

// Model 3
xtreg pvv_symp c.income_cpi3##c.rfg_sh i.year if sample==1 & sec_target==0, fe robust

// Model 4
xtreg pvv_symp c.income_cpi3##c.rfg_sh age degree hhsize unemployed fb_pct asc sh_pct leduc_pct decline stu i.year if sample==1 & sec_target==0, fe robust

// Model 5
xtreg pvv_symp c.income_cpi3##c.rfg_sh i.year if sample==1 & sec_target==1, fe robust

// Model 6
xtreg pvv_symp c.income_cpi3##c.rfg_sh age degree hhsize unemployed fb_pct asc sh_pct leduc_pct decline stu i.year if sample==1 & sec_target==1, fe robust


* Table S.11 
* Overview of the robustness tests for support for the populist right
use "liss_L1L2", clear

* (0) Original model
xtreg pvv_symp c.income_cpi3##c.rfg_sh age degree hhsize unemployed fb_pct asc sh_pct leduc_pct i.year if sample==1 & sec_target==1 & decline==0, fe robust

* (1) Social class
xtreg pvv_symp c.income_cpi3##c.rfg_sh age degree hhsize unemployed fb_pct asc sh_pct leduc_pct i.soc_class i.year if sample==1 & sec_target==1 & decline==0, fe robust

* (2) Authoritarianism
xtreg pvv_symp c.income_cpi3##c.rfg_sh age degree hhsize unemployed fb_pct asc sh_pct leduc_pct laworder i.year if sample==1 & sec_target==1 & decline==0, fe robust

* (3) Urban area
xtreg pvv_symp c.income_cpi3##c.rfg_sh age degree hhsize unemployed fb_pct asc sh_pct leduc_pct i.sted i.year if sample==1 & sec_target==1 & decline==0, fe robust

* (4) Large cities interaction
xtreg pvv_symp c.income_cpi3##c.rfg_sh##i.g4 age degree hhsize unemployed fb_pct asc sh_pct leduc_pct i.year if sample==1 & sec_target==1 & decline==0, fe robust

* (5) Population size
xtreg pvv_symp c.income_cpi3##c.rfg_sh age degree hhsize unemployed fb_pct asc sh_pct leduc_pct pop i.year if sample==1 & sec_target==1 & decline==0, fe robust

* (6) Population density
xtreg pvv_symp c.income_cpi3##c.rfg_sh age degree hhsize unemployed fb_pct asc sh_pct leduc_pct density i.year if sample==1 & sec_target==1 & decline==0, fe robust

* (7) Ideology
xtreg pvv_symp c.income_cpi3##c.rfg_sh age degree hhsize unemployed fb_pct asc sh_pct leduc_pct ideology i.year if sample==1 & sec_target==1 & decline==0, fe robust

* (8) Homeownership
xtreg pvv_symp c.income_cpi3##c.rfg_sh age degree hhsize unemployed fb_pct asc sh_pct leduc_pct homeowner i.year if sample==1 & sec_target==1 & decline==0, fe robust

* (9) Out of the labor force
xtreg pvv_symp c.income_cpi3##c.rfg_sh age degree hhsize unemployed fb_pct asc sh_pct leduc_pct inactive i.year if sample==1 & sec_target==1 & decline==0, fe robust

* (10) Private rental market
xtreg pvv_symp c.income_cpi3##c.rfg_sh age degree hhsize unemployed fb_pct asc sh_pct leduc_pct pr_pct i.year if sample==1 & sec_target==1 & decline==0, fe robust

* (11) Average housing value
xtreg pvv_symp c.income_cpi3##c.rfg_sh age degree hhsize unemployed fb_pct asc sh_pct leduc_pct ahv_cpi i.year if sample==1 & sec_target==1 & decline==0, fe robust

* (12) Vacant private rental
xtreg pvv_symp c.income_cpi3##c.rfg_sh age degree hhsize unemployed fb_pct asc sh_pct leduc_pct vrpr i.year if sample==1 & sec_target==1 & decline==0, fe robust

* (13) Young adults 
xtreg pvv_symp c.income_cpi3##c.rfg_sh age degree hhsize unemployed fb_pct asc sh_pct leduc_pct yng_pct i.year if sample==1 & sec_target==1 & decline==0, fe robust

* (14) Vacancy rates social housing
xtreg pvv_symp c.income_cpi3##c.rfg_sh age degree hhsize unemployed fb_pct asc sh_pct leduc_pct vrsh i.year if sample==1 & sec_target==1 & decline==0, fe robust

* (15) Unemployment rate
xtreg pvv_symp c.income_cpi3##c.rfg_sh age degree hhsize unemployed fb_pct asc sh_pct leduc_pct ur i.year if sample==1 & sec_target==1 & decline==0, fe robust

* (16) Industrial jobs
xtreg pvv_symp c.income_cpi3##c.rfg_sh age degree hhsize unemployed fb_pct asc sh_pct leduc_pct ind_pct i.year if sample==1 & sec_target==1 & decline==0, fe robust

* (17) Benefit recipients
xtreg pvv_symp c.income_cpi3##c.rfg_sh age degree hhsize unemployed fb_pct asc sh_pct leduc_pct bnft_pct i.year if sample==1 & sec_target==1 & decline==0, fe robust
 
* (18) Non-trimmed measure
xtreg pvv_symp c.income_cpi3##c.rfg_sh_all age degree hhsize unemployed fb_pct asc sh_pct leduc_pct i.year if sample==1 & sec_target==1 & decline==0, fe robust

* (19) Stock-based measure
xtreg pvv_symp c.income_cpi3##c.rfg_sh_alt age degree hhsize unemployed fb_pct asc sh_pct leduc_pct i.year if sample==1 & sec_target==1 & decline==0, fe robust

* (20) Post-2009 years
xtreg pvv_symp c.income_cpi3##c.rfg_sh age degree hhsize unemployed fb_pct asc sh_pct leduc_pct i.year if sample==1 & sec_target==1 & decline==0 & year>2009, fe robust

* (21) Municipal reforms
xtreg pvv_symp c.income_cpi3##c.rfg_sh age degree hhsize unemployed fb_pct asc sh_pct leduc_pct i.year if sample==1 & sec_target==1 & decline==0 & reform==0, fe robust

* (22) Exposure effect
xtreg pvv_symp c.rfg_sh##c.fb_pct income_cpi3 age degree hhsize unemployed asc sh_pct leduc_pct i.year if sample==1 & sec_target==1 & decline==0 & reform==0, fe robust

* (23) Ethnically homogenous areas
sum fb_pct if sample==1, detail
xtreg pvv_symp c.income_cpi3##c.rfg_sh age degree hhsize unemployed fb_pct asc sh_pct leduc_pct i.year if sample==1 & sec_target==1 & decline==0 & fb_pct<r(p50), fe robust 

* (24) Binary dependent variable
xtlogit pvv_symp2 c.income_cpi3##c.rfg_sh age degree hhsize unemployed fb_pct asc sh_pct leduc_pct i.year if sample==1 & sec_target==1 & decline==0, fe or

* (25) Gross income
xtreg pvv_symp c.gross_cpi3##c.rfg_sh age degree hhsize unemployed fb_pct asc sh_pct leduc_pct i.year if sample==1 & sec_target==1 & decline==0, fe robust

* (26) Random effects
xtreg pvv_symp c.income_cpi3##c.rfg_sh age degree hhsize unemployed fb_pct asc sh_pct leduc_pct i.year if sample==1 & sec_target==1 & decline==0, re robust